home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 120
/
Vol 120.iso
/
games
/
titans
/
beastboy.swf
/
scripts
/
DefineSprite_288
/
frame_1
/
DoAction.as
Wrap
Text File
|
2010-11-09
|
995b
|
56 lines
range = 300;
xs = 3;
xmin = _X;
xmax = _X + range;
shootdelay = 15;
d = shootdelay;
spider.body.body.ca1.off = 1;
spider.body.body.ca2.off = 0;
onenterframe = function()
{
_X = _X + xs;
if(_X > xmax)
{
_X = xmax;
xs = - xs;
spider.body.body.ca1.off = 0;
spider.body.body.ca2.off = 1;
}
else if(_X < xmin)
{
_X = xmin;
xs = - xs;
spider.body.body.ca1.off = 1;
spider.body.body.ca2.off = 0;
}
d--;
if(!d)
{
d = shootdelay;
if(math.abs(p._y - _Y) < 20)
{
if(math.abs(p._x - _X) < 600)
{
if(xs < 0 and p._x - _X < 0)
{
bulletlaunch(6);
}
else if(xs > 0 and p._x - _X > 0)
{
bulletlaunch(5);
}
}
}
}
cekhitattack(z);
if(die)
{
gotoAndPlay(4);
}
else
{
cekhitp(z2);
}
};
stop();